<%-- 
    Document   : manageCategories
    Created on : Dec 14, 2009, 2:31:53 PM
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>List product: ${catParent.name}</title>
        <style type="text/css">
            .selected {
                background: yellow;
            }
        </style>

    </head>
    <body>
        <table border="1">
            <tr>
                <th colspan="8">List products: ${catParent.doName$}</th>
            </tr>
            <tr>
                <td colspan="8">
                    <%--${sgt.supermarket.util.HtmlExtension.getCategoryTreeHTML$2[catParent]["?catid=%d"]}--%>
                    ${catParent.getCategoryTreeHTML$1["?catid=%d"]}
                </td>
            </tr>
            <tr>
                <th>#</th><th>Name</th><th>Code</th><th>Selling price</th><th>Available quantity</th>
            </tr>
            <c:forEach var="product" items="${products}" varStatus="counter">
                <tr>
                    <td>${counter.count}</td>
                    <td><a href="<%=request.getContextPath()%>/product/view?id=${product.autoId}">${product.name}</a></td>
                    <td>${product.code}</td>
                    <td>${product.currentSellingPrice} VND</td>
                    <td>${product.totalAvailable} (${product.unit})</td>
                    <td>
                        <a href="<%=request.getContextPath()%>/product/edit?id=${product.autoId}">Edit</a>
                    </td>
                    <td><form method="post"><input type="hidden" name="removeId" value="${product.autoId}"/>
                            <input type="submit" name="remove" value="Remove"/></form></td>
                    <td><a href="<%=request.getContextPath()%>/product/purchase?pid=${product.autoId}">Add purchase</a></td>
                </tr>
            </c:forEach>
            <tr>
                <td>*</td>
                <td colspan="7">
                    <form method="post" action="<%=request.getContextPath()%>/product/edit">
                        <input type="hidden" name="catid" value="${catParent.autoId}"/>
                        <input type="submit" value="Add new" />
                    </form>
                </td>
            </tr>
        </table>
    </body>
</html>
